﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Internal.Master" Inherits="System.Web.Mvc.ViewPage" %>

<%@ Import Namespace="Webdiyer.WebControls.Mvc" %>
<%@ Import Namespace="BPM.Entity" %>
<%@ Import Namespace="BPM.ViewModel" %>
<%@ Import Namespace="BPM" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	物料搜索
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ScriptStyleContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
	<%
		var models = this.ViewData["Models"] as PagedList<MaterialDefinition>;
		var condition = this.ViewData["PreviousSeachCondition"] as StorageSearchCondition;
		var ad = AD.Singleton.MaterialManagement;
	%>
	<p>
		供应商名称:<input type="text" id="companyName" value="<%= Html.ifnotnull(condition, c => c.CompanyName) %>" />
		物料名称:<input type="text" id="materialName" value="<%= Html.ifnotnull(condition, c => c.MaterialName) %>" />
		<input type="hidden" id="page" value="<%=Html.ifnotnull(condition, c => c.Page) %>" />
		<input type="button" value="搜索" onclick="search()" />
	</p>
	<div>
		<%
			if (models.Count <= 0)
			{
		%>
		暂时没有数据
		<%
			}
			else
			{
		%>
		<table class="altTable" cellpadding="0" cellspacing="0">
			<thead>
				<tr>
					<td>
						识别条码
					</td>
					<td>
						物料名称
					</td>
					<td>
						存量
					</td>
					<td>
						所属大类
					</td>
					<td>
						所属小类
					</td>
					<td>
						品牌
					</td>
					<td>
						价格
					</td>
					<td>
						供应商名称
					</td>
					<td>
						联系人
					</td>
					<td>
						联系电话
					</td>
					<td>
						付款方式
					</td>
				</tr>
			</thead>
			<tbody>
				<%
					foreach (var model in models)
					{
				%>
				<tr>
					<td>
						<%:model.Barcode.Number %>
					</td>
					<td>
						<%:model.Name %>
					</td>
					<td>
						<%:model.CurrentAmount %>
					</td>
					<td>
						<%:model.Category.ParentCategory.Name %>
					</td>
					<td>
						<%:model.Category.Name %>
					</td>
					<td>
						<%:model.Brand %>
					</td>
					<td>
						<%:model.Price %>
						元
					</td>
					<td>
						<%:model.SupplierName%>
					</td>
					<td>
						<%:model.ContactName %>
					</td>
					<td>
						<%:model.ContactPhone %>
					</td>
					<td>
						<%:model.DeliveryPeriod %>
						<%:model.DeliverPeriodUnit %>
					</td>
				</tr>
				<%
					}
				%>
			</tbody>
		</table>
		<%
			}
		%>
	</div>
	<%=Html.NewPager(models, new
{
	companyName = condition.CompanyName,
	materialName = condition.MaterialName,
	page = condition.Page
})%>
</asp:Content>
